﻿<!doctype html>
<html>
<head>
    <title>微街秀 > 红包分享</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <link href="plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/css.css?25">
    <link rel="stylesheet" type="text/css" href="css/Makeresult.css?a=1">
    <link href="css/MakeAdvertMain.css" rel="stylesheet" type="text/css" />
    <script src="js/ajax-data.js" type="text/javascript"></script>
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
    <style type="text/css">
        .fixedHiden{position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: black;opacity: 0.3;z-index: 99;display: none;}
        .wrap_detail{border: 1px solid rgba(0,0,0,.2);margin: 10px 15px 0 15px;background-color: #F9F9FA;font-size: 14px;line-height: 24px;-webkit-border-radius: 5px;border-radius: 5px;box-shadow: 0 1px 1px #f6f6f6;padding: 15px;color: #333;}
        .cententxt .over{background: #ccc;color: #999;}
    </style>
</head>
<body>
    <div class="wamtop">
        <div class="topcententxt">
            分享</div>
        <div class="topright" style="color: white;" onclick="window.location.href='Makead_1.html?25'">
            推广</div>
    </div>
    <div class="selectTags">
        <table class="tab">
            <tbody>
                <tr>
                    <td>
                        <div class="model" id="Share" style="color: rgb(243, 123, 11); background-color: rgb(231, 231, 231);">
                            <img src="img/Makeimg/newicon/2.png">
                            <div>
                                红包分享
                            </div>
                            <div class="border" style="border-bottom-width: 2px; border-bottom-color: rgb(243, 123, 11);
                                border-bottom-style: solid;">
                            </div>
                    </td>
                    <td>
                        <div class="model" id="effect" style="background-color: rgb(244, 244, 244);" onclick="window.location.href='makesh_2.html'">
                            <img src="img/Makeimg/newicon/3.png">
                            <div>
                                红包记录
                            </div>
                            <div class="border" style="">
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="model" id="pubsilh" style="background-color: rgb(244, 244, 244);" onclick="window.location.href='makesh_3.html?25'">
                            <img src="img/Makeimg/newicon/5.png">
                            <div>
                                我的财富
                            </div>
                            <div class="border">
                            </div>
                        </div>
                    </td>
                    <td>
                        <div class="model" id="cost" style="background-color: rgb(244, 244, 244);" onclick="window.location.href='makesh_4.html?25'">
                            <img src="img/Makeimg/newicon/7.png">
                            <div>
                                我的设置
                            </div>
                            <div class="border" style="">
                            </div>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="Tags">
        <div class="Tagtxt">
            红包分享</div>
        <div class="numclass">
            <b class="sanjiao"></b>
            <div class="countnum">
                0条</div>
        </div>
        <div class="tg_select">
        </div>
        <div class="bottom">
            <ul>
                <li>
                    <div onclick="window.location.href='index.html?25'">
                        <img src="img/tab1_g.png" /><br />
                        发现
                    </div>
                </li>
                <li>
                    <div onclick="window.location.href='publish.html?25'">
                        <img src="img/tab2_g.png" /><br />
                        发布
                    </div>
                </li>
                <li>
                    <div id="tab3" class="Defutalcolor" style="position: relative;">
                        <img src="img/tab3_y.png" />
                        <br />
                        推广
                    </div>
                </li>
                <li>
                    <div onclick="if(login())window.location.href = 'Personal.html?25'">
                        <img src="img/tab4_g.png" /><br />
                        我的
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <div id="redshow" style="position: fixed; background: #DA3931; width: 240px; top: 100px;
        display: none; left: 50%; z-index: 999; border-radius: 5px; padding-bottom: 100px;
        margin-left: -120px;">
        <div style="background: #B22C23; width: 100%; height: 100px; border-radius: 5px;">
            <span style="font-size: 20px; float: right; margin: 8px;" id="close">×</span>
            <div style="color: white; position: absolute; top: 90px; left: 50%; width: 200px;
                margin-left: -100px; text-align: center;" class="Titletxt">
            </div>
        </div>
        <div style="background: #B22C23; width: 100%; height: 120px; border-bottom-left-radius: 120px;
            border-bottom-right-radius: 120px;">
        </div>
        <div style="position: absolute; top: 166px; left: 50%; margin-left: -35px;" class="Rob">
            <img src="img/Makeimg/22.png" id="Getimg" style="position: absolute; height: 80px;
                top: 0;">
        </div>
    </div>
    <div class="fixedHiden" style="opacity: 1;">
    </div>
    <input type="hidden" id="advrtid" value="" />
    <!--下载提示-->
    <div class="wrap_detail" style="width: 200px; background-color: White; position: fixed;
        top: 20%; display: none;">
        <div class="content">
            <table cellpadding="0" cellspacing="0" style="border: 0px; width: 100%;">
                <tbody>
                    <tr>
                        <td style="width: 60px;">
                            <img src="../download/logo.png" style="width: 40px;">
                        </td>
                        <td style="padding-left: 8px; font-weight: bold; color: #FBA94A; font-size: 16px;">
                            微街秀
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            安装APP，抢红包更方便！
                        </td>
                    </tr>
                </tbody>
            </table>
            <a href="javascript:" onclick="javascript:$('.wrap_detail').css('display','none')">
                <div style="position: absolute; width: 33px; height: 40px; top: 0px; right: 0px">
                    关闭
                </div>
            </a>
        </div>
        <div class="content" style="border-bottom: 0px;">
            <table cellpadding="0" cellspacing="0" style="border: 0px; width: 100%; margin-top: 10px;">
                <tbody>
                    <tr>
                        <td align="center" style="width: 50%;">
                            <a href="http://wjx.711688.com/download">
                                <img src="../download/android.png" style="width: 80px;"><br />
                                扫一扫</a>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" style="width: 50%;">
                            <a id="a_android" href="http://wjx.711688.com/download">立即下载 </a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>



    <div class="backimg-panl buzhou hide">
        <div class="font-content" style="right: -150px;">
            <img src="img/buzhou/2_1.png" style="width: 50%;" />
            <div>
                <p>
                    此处可切换</p>
                <p>
                    推广和</p>
                <p>
                    分享角色</p>
                <button class=" btn btn-color btn-default " onclick="NextBZ(1)">
                    下一步</button>
            </div>
        </div>
    </div>
    <div class="backimg-panl buzhou hide">
        <div class="font-content" style="top: 5%;">
            <img src="img/buzhou/2_2.png" style="width: 50%" />
            <div class=" text-center">
                <p>
                    点击红包分享</p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="UpBZ(1)">
                        上一步</button></p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="NextBZ(2)">
                        下一步</button></p>
            </div>
        </div>
    </div>
    <div class="backimg-panl buzhou hide">
        <div class="font-content" style="right: -65px; top: 45%;">
            <img src="img/buzhou/2_3.png" class=" center-block" style="width: 50%;" />
            <div class=" text-center" style="margin-bottom: -70px;">
                <p>
                    点击分享按钮</p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="UpBZ(2)">
                        上一步</button></p>
                <p>
                    <button class=" btn btn-color btn-default " onclick="NextBZ(3)">
                        下一步</button></p>
            </div>
        </div>
    </div>
    <div class="backimg-panl buzhou hide">
        <div class="font-content" style="top: 40%;">
            <img src="img/buzhou/2_4.png" class=" center-block" style="width: 50%; margin-left: 13%;" />
            <div class=" text-center" style="margin-bottom: -70px;">
                <p>
                    点此按钮抢红包</p>
                <p>
                    <button class=" btn btn-color btn-default "  onclick="SetBZ(21)">
                        知道了</button></p>
            </div>
        </div>
    </div>
    <script>

        ShowBZ(21); //显示引导
        var left = -40;
        var img = document.getElementById('Getimg');
        var imgWidth = 80;
        var pi = Math.PI;
        var x = 0, temp = 0;
        var set;
        function init() {
            document.getElementById('Getimg').style.left = left + 'px';
            set = setInterval('goOn()', 1);
        }
        function goOn() {
            temp = Math.cos(x);
            document.getElementById('Getimg').style.width = Math.abs(imgWidth * temp) + 'px';
            document.getElementById('Getimg').style.left = (left + (imgWidth - Math.abs(imgWidth * temp / 2))) + 'px';
            if (temp < 0) {
                document.getElementById('Getimg').style.filter = 'FlipH(enabled:true)';
            } else {
                document.getElementById('Getimg').style.filter = 'FlipH(enabled:false)';
            }
            x += pi / 90;
        }

        var article_id = "0";   //文章ID,从推送消息进来的带ID
        var pagecount = "0";
        var page = 1;
        var keyword = "";   //关键词
        $(document).ready(function () {
          
            article_id = getQueryString("article_id");
            $("#close").click(function () { $(".fixedHiden").css("display", "none"); $("#redshow").css("display", "none"); });
            $("#Getimg").bind("click", qiang);
            $("#searchico").click(function () { $("#ws_tg").html(""); load(page) });

            if (IsMobile() < 1) {
                //终端登录验证
                if (getCookie("userid") == null || getCookie("userid") == "") {
                    window.location.href = 'login.html';
                    return;
                }
                //提示下载APP打开
                $("#bodytop").click();
                $(".wrap_detail").css("margin-left", parseInt($(".wamtop").css("width")) / 2 - 120);
                $(".wrap_detail").css("display", "");
            }
            else {
                load(page);
                $(window).bind("scroll", function () {
                    //当滚动条滚动时
                    var scollTop = $(this).scrollTop() + $(this).height();
                    var scollH = $(document).height();
                    if (scollH - scollTop < 100) {
                        page++;
                        load(page);
                    }
                    return false;
                });

                if (article_id > 0) {
                    $("#redshow").css("display", "block");
                    $(".fixedHiden").css("display", "block");
                    $("#advrtid").val(article_id);
                }
            }

        });

        var area1, area2, area3;
        function load(page) {          
            if (pagecount == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
           
            keyword = $("#Stext").val();
            InitLocation(); //加载区域
           
            AjaxStart("ajax/fc_article.ashx?getlist_shared", "&page_index=" + page + "&area1=" + area1 + "&area2=" + area2 + "&area3=" + area3, function (data) {
                if (data.code == "4") { pagecount = "1"; return; }
                if (data.code == 0) {
                    if (data.item.pageCount < page) {
                        if (pagecount == "0")
                            Alert('到底了！');
                        pagecount = "1"; return;
                    }
                    $(".countnum").html(data.item.itemCount + " 条");
                    loadhtml(data);
                }
                else {
                    if (data.code == 10 || data.code == 11 || data.code == 12) {
                        Alert(data.msg);
                        setTimeout(function () { window.location.href = "Makesh_4.html" }, 1000);
                    }
                }
                if (data.item.itemCount > 0)
                    $("#tab3").append("<div class=\"newRed\"></div>");
            });
        }

        function loadhtml(data) {
            $(data.item.table).each(function () {
                var link = "分享";
                var logo = this.logo == null ? "img/30.png" : this.logo;
                var picurl = this.picurl;
                var by_user_id = this.by_user_id;
                var money_id = this.money_id;
                var shared_id = this.shared_id;
                var title = this.title;
                var titlelenth = 12;
                var css = '';
                if (document.body.scrollWidth > 325) { titlelenth = 16; }
                if (title.length > titlelenth)
                    title = title.substr(0, titlelenth) + "...";

                if (by_user_id > 0) {    
                    if (picurl == null || picurl == '')
                        link = '上传'
                    else if (picurl != '') {
                        link = '已抢';
                        css = 'over';
                    }
                }
                if (this.op_remainder < 1) {
                    link = '抢完';
                    css = 'over';
                }

                $(".tg_select").append("<div class=\"centenlist\" id=\"" + this.id + "\"><div class=\"centenimg\"><img src=\"" + logo + "\"></div><div class=\"cententxt\">" +
                "<div class=\"cententxttop\" >" +
                "<strong>" + title + "</strong></div>" +
                "<div class=\"centenTime\">" + this.date.substr(0, 10) + "</div>" +
                "<div class=\"advrtcentenflow " + css + "\">" + link + "</div></div></div>");


                //抢了红包，未上传截图
                if (by_user_id > 0 && (picurl == null || picurl == '')) {
                    $("#" + this.id).click(function () {
                        window.location.href = 'makeshareupload.html?id=' + shared_id + '&money_id=' + money_id + "&article_id=" + article_id;
                    });
                }
                else if (by_user_id <= 0 && this.op_remainder > 0) {
                    //抢新红包
                    $("#" + this.id).click(function () {
                        $("#redshow").css("display", "block");
                        $(".fixedHiden").css("display", "block");
                        $(".Titletxt").html($(this).find("strong").text());
                        $("#advrtid").val("");
                        $("#advrtid").val($(this).attr("id"));
                    });
                }
            });

            //推送过来的链接，直接显示抢红包界面
            if (article_id > 0)
                $(".Titletxt").html($("#" + article_id).find("strong").text());
        }

        var oldmsg = "";
        function qiang() {
            var id = $("#advrtid").val();
            if (id == "") {
                Alert("参数错误,抢红包失败!");
                return;
            }
            if (oldmsg == "账号未审核") {
                Alert(oldmsg)
                return;
            }
            if (!checkHB(id)) {
                Alert("一台手机不能重复抢红包!");
                return;
            }
            AjaxStart("ajax/fc_shared_money.ashx?qiang", "&article_id=" + id, function (data) {
                if (data.code == 0) {
                    $("#Getimg").bind("click", function () { Alert("正在跳转请稍等...") });
                    window.location.href = "fc_detail.aspx?article_id=" + $("#advrtid").val() + "&money_id=" + data.item;
                }
                oldmsg = data.msg;
                Alert(data.msg);
            });
        }
        function InitLocation() {
            if (IsMobile() < 1) return;
            var arr = getCookie('area');
            if (arr != null) {
                arr = arr.split(',');
                if (arr.length > 2) {
                    area1 = arr[0];
                    area2 = arr[1];
                    area3 = arr[2];
                } 
            }
        }
    </script>
</body>
</html>
